package com.it.common.mapper;

import com.it.common.config.InsertBatchMapper;
import com.it.common.domain.dos.ArticleTagRelDO;

import java.util.List;

public interface ArticleTagRelMapper extends InsertBatchMapper<ArticleTagRelDO> {

    int deleteByArticleId(Long articleId);

    List<ArticleTagRelDO> selectByArticleId(Long articleId);


    /**
     * @param tagId
     * 根据标签 ID 查询
     * @return {@link ArticleTagRelDO }
     */
    ArticleTagRelDO selectOneByTagId(Long tagId);


    /**
     * 批量查询
     * @param articleIds
     * @return {@link List }<{@link ArticleTagRelDO }>
     */
    List<ArticleTagRelDO> selectByArticleIds(List<Long> articleIds);


    /**
     * 查询该标签 ID 下所有关联记录
     * @param tagId
     * @return {@link List }<{@link ArticleTagRelDO }>
     */
    List<ArticleTagRelDO> selectByTagId(Long tagId);
}
